{extend name="public/base" /}

{block name="body"}
    <div class="main-title">
        <h2>{$meta_title}</h2>
    </div>
    <form action="{:url()}" method="post" class="form-horizontal">
    	
    	<div class="form-item cf">
			<label class="item-label">课程名称</label>
			<div class="controls">
				<span>{$_info.course_id|get_course}</span>
			</div>
		</div>
					
    	<div class="form-item">
            <label class="item-label">选择操作 *</label>
            <div class="controls">
	            <select name="hour_type" class="input-large" id="hour_type">
					<option value="0">扣减课时</option>
					<option value="1">充值课时</option>
				</select>
			</div>
        </div>
        
        <div class="form-item" style="display:none" id="pay_type">
            <label class="item-label">充值方式 *</label>
            <div class="controls">
	            <select name="pay_type" id="select_pay_type" class="input-large">
	            	<option value="0">选择操作</option>
					{volist name=":config('course_pay_type')" id="vo"}
						<option value="{$key}">{$vo}</option>
					{/volist}
				</select>
			</div>
        </div>
        
        <div class="form-item">
            <label class="item-label">课时数<span class="check-tips">（总课时,单位小时）</span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="hours" value="">
            </div>
        </div>
        
        <div class="form-item">
			<label class="item-label">备注</label>
			<div class="controls">
				<label class="textarea input-large"><textarea name="comment"></textarea></label>
			</div>
		</div>
		
        <div class="form-item">
        	<label class="item-label"></label>
        	<input type="hidden" name="student_id" value="{$_info.student_id}"/>
        	<input type="hidden" name="course_id" value="{$_info.course_id}"/>
            <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
{/block}

{block name="script"}
    <script type="text/javascript">
		//选择结算方式
		$("#hour_type").on('change', function(event){
	    	var hour_type = $(this).val();
	    	if(hour_type === '1'){
	    		$("#pay_type").css("display","block");
	    	}else{
	    		$("#pay_type").css("display","none");
	    		Think.setValue("pay_type", 0);
	    	}
		});
        //导航高亮
        highlight_subnav('{:url('Student/index')}');
    </script>
{/block}
